package gba.dnp.graphics;

import javax.swing.JPanel;

public class ViewController implements Runnable {
	
	private ViewModel model;
	private JPanel area;

	public ViewController(ViewModel model, JPanel area) {
		super();
		this.model = model;
		this.area = area;
	}

	@Override
	public void run() {
		Vector2D speed = new Vector2D(3, 2);
		while(true){
			model.setPosition(model.getPosition().add(speed));
			area.repaint();
			try {
				Thread.sleep(200);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}	
}
